import 'package:appflutterhomeschool/res/styles.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

///用户： ninetailedfox
///时间： 2020/7/2
///邮箱： 1037438704@qq.com
///功能： 组件
///收藏组件
class CollectionWidget extends StatelessWidget {
  final bool visible;
  final GestureTapCallback onTap;
  final String textContext;


  CollectionWidget({this.visible, this.onTap,this.textContext});

  @override
  Widget build(BuildContext context) {
    return Visibility(
      visible: visible??true,
      child:GestureDetector(
        onTap: onTap,
        child:Row(
          children: <Widget>[
            Icon(Icons.grade,
                color: Colors.blue,
                size: ScreenUtil().setWidth(30)),
            Padding(
              padding: EdgeInsets.only(
                  left: 3, right: ScreenUtil().setWidth(35)),
              child:
              Text(textContext??"我的收藏", style: TextStyles.textContent31),
            ),
          ],
        ),
      ),
    );
  }
}

///筛选组件
class ScreenWidget extends StatelessWidget {
  final bool visible;
  final GestureTapCallback onTap;


  ScreenWidget({this.visible, this.onTap});

  @override
  Widget build(BuildContext context) {
    return Visibility(
      visible: visible,
      child:GestureDetector(
        onTap: onTap,
        child:Row(
          children: <Widget>[
            Icon(
              Icons.format_list_bulleted,
              color: Colors.black,
              size: ScreenUtil().setSp(37),
            ),
            Padding(
              padding: EdgeInsets.only(left: 5, right: 10),
              child: Text("筛选", style: TextStyles.textDark37),
            )
          ],
        ),
      ),
    );
  }
}



